package
{
	import capricornus.components.tilelist.TileList;
	import capricornus.core.RefreshManager;
	import capricornus.events.dispatcher.EventDispatcherEx;
	import capricornus.res.Image;
	
	import com.greensock.TweenLite;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	[SWF(width="1000",height="600")]
	public class LoadTest extends Sprite
	{
		private var _list:TileList;
		
		private var _ed:EventDispatcherEx;
		
		public function LoadTest()
		{
			super();
			init();
		}
		
		private function init():void
		{
			_ed = new EventDispatcherEx();
			_ed.addEventListener( Event.COMPLETE, onComplete );
			
			var image:Image = new Image();
			image.x = 300;
			image.y = 200;
			image.source = "role02.png";
			image.alpha = 0;
			image.scaleX = image.scaleY = 0;
			image.rotation = 0;
			addChild( image );
			
			TweenLite.to( image, 3, { rotation:-360, alpha:1, scaleX:1, scaleY:1, onComplete:step2 } );
			
			stage.addEventListener( MouseEvent.CLICK, onClick );
		}
		
		private var _event:Event = new Event( Event.COMPLETE );
		private function onClick( e:MouseEvent ):void
		{
			_ed.dispatchEvent( _event );
		}
		
		private function onComplete( e:Event ):void
		{
			trace( e );
		}
		
		private function step2():void
		{
			trace( "dddd" );
		}
	}
}